<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tests</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAT3TWfMATChtqQlhy3rBImRSsHxnIok2KLD68NIgI81Lh7Wi2ThTe_2srKomD6r2DUDpVToggp3OBmQ&amp;sensor=false"></script>
<script type="text/javascript" src="../jsunit/app/jsUnitCore.js"></script>
<script type="text/javascript" src="../vizmapper.js"></script>
<script type="text/javascript">
//<![CDATA[

function setUp(){
	VMap = new VMapper("map");
}

function tearDown(){
	VMap = 0;
}

function setUpPage(){
	setUpPageStatus = 'complete';
}

function testVMapperConstructor(){
	assert("VMapper object successfully instantiated", VMap instanceof VMapper);
}

function testVMapperGMapInstantiated(){
	assert("VMap map object successfully instantiated", VMap.map instanceof GMap2);
}

function testVMapperLoadsAddresses(){
	VMap.loadAddresses("addresses1");
 	assert("Testing VMapper data loads correctly when there is at least one address", VMap.addresses.length > 0);
}

function testVMapperLoadsNoAddresses(){
	VMap.loadAddresses("addresses2");
 	assert("Testing VMapper data loads correctly when there are no addresses", VMap.addresses.length == 0);
}

function testVMapperCreateMarker(){
	var point = new GLatLng(37.4419, -122.1419);
	var html = "An event window";
	var marker = VMapper.createMarker(point, html);
 	assert("Testing VMapper successfully creates markers", marker instanceof GMarker);
}

//]]>
</script>
</head>

<body onunload="GUnload()"> 
	<div id="map"></div>
	<ul id="addresses1">
		<li id="address0">17 Raphael Road, Hove, East Sussex, England</li>
		<li id="address1">27 Kingsley Avenue, Ealing, London, England</li>
		<li id="address2">This address will fail to be found</li>
	</ul>
	<ul id="addresses2">
	</ul>
</body>
</html>
